#ifndef _TBOX_SIMULINK_H_
#define _TBOX_SIMULINK_H_

#include <stdint.h>

#ifdef __cplusplus
extern "C"
{
#endif

	typedef struct
	{
		struct
		{
			int ft;			
			float f_air;	
			float f_wai;	
			float f_nei;	
			float f_obj;	
			float f_cooler; 
		} temp;				

		struct
		{
			float add_duty;			 
			float add_coef;			 
			float cool_sub_coef;	 
			float auto_sub_coef;	 
			float wat_auto_add_coef; 
			float volume_stream;	 
			float volume_box;		 
			float col_humi;			 
			float col_air;			 
			float col_leakage;		 
		} humi;						 

		struct
		{
			uint8_t b_low;		
			uint8_t b_high;		
			float f_press;		
			float da_qi_ya;		
			char b_air_out;		
			float kong_qi_bili; 
			float ft_buff;		
		} press;				

		char b_feng_shan; 
		char b_door_open; 
		struct
		{
			float main_duty_flt;	
			float ext_duty_flt;		
			float main_heat_duty;	
			float ext_heat_duty;	
			float main_heat_period; 
			float ext_heat_period;	
			float nei_heat_pow;		
			float ext_heat_pow;		
		} heat;

		struct
		{
			char b_bu_shui;	   
			char b_pai_shui;   
			char b_wt_low;	   
			char b_wt_high;	   
			float f_shui_wei;  
			float f_used_coef; 
		} water;

		struct
		{
			float fast_duty;	  
			float slow_duty;	  
			float fast_fill_coef; 
			float slow_fill_coef; 
			float fill_flt;		  
			float fill_old;		  
			float volume_gas;	  
			float volume_box;	  
			float col_gas;		  
			float col_in_air;	  
			float col_leakage;	  
		} gus[4];

		struct
		{
			float nei;	  
			float wai;	  
			float obj;	  
			float cooler; 

			float re_rong_liang_nei;	
			float re_rong_liang_wai;	
			float re_rong_liang_obj;	
			float re_rong_liang_cooler; 

			float tran_coef_neiwai;			  
			float tran_coef_neiobj;			  
			float tran_coef_wai_air_with_ndr; 
			float tran_coef_wai_air_with_fan; 
			float tran_coef_wai_air_none_fan; 
			float tran_coef_nei_cool;		  
			float cool_pow;					  
			float cool_flt;					  
			float cool_real;				  
		} neng_liang;
	} sim_type;

	extern sim_type sim_obj;

	void sim_init_default(void);
	void simulink_run(void);

#ifdef __cplusplus
}
#endif

#endif 
